<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function sum() {
            var s = 0;
            for (var i = 0; i < arguments.length; i++) {
                var item = arguments[i]
                if (!isNaN(item)) {
                    s += arguments[i]
                }
            }
            return s
        }
        console.log(sum(2, 3, 4, 5));
        console.log(sum(2, 's', 3, 4, 's'));
        console.log(sum(1, 2, 5));
    </script>
</body>

</html>